#include <stdio.h>

int main ()
{
    int c;
    int cnt = 0;
    while ((c = getchar()) != EOF) {
        if (c == ' ' && cnt == 0) {
            putchar(c);
            ++cnt;
        }
        else if (c == ' ' && cnt != 0) {
            ++cnt;
            continue;
        }
        else {
            putchar(c);
            cnt = 0;
        }
    }
    return 0;
}